package com.solute.utils.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solute.domain.SolutionVO;
import com.solute.utils.services.dao.SolutionDao;

@Service
public class SolutionService {
	@Autowired
	private SolutionDao dao;
	
	public <T> SolutionVO getById(T id) {
		return dao.selectSolutionById(id);
	}
	
	public int size() {
		return dao.selectNumSolutions();
	}
	
	@Transactional
	public <T> void add(T param) {
		dao.insertSolution(param);
	}
	
	@Transactional
	public <T> void removeById(T id) {
		dao.deleteSolutionById(id);
	}
	
	@Transactional
	public void removeAll() {
		dao.deleteSolutions();
	}
}
